package com.ruoyi.web.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.mapper.ApiBannerMapper;
import com.ruoyi.web.entity.ApiBanner;
import com.ruoyi.web.service.IApiBannerService;

/**
 * 轮播图配置Service业务层处理
 * 
 * @author youwei
 * @date 2023-12-01
 */
@Service
public class ApiBannerServiceImpl implements IApiBannerService 
{
    @Autowired
    private ApiBannerMapper apiBannerMapper;

    /**
     * 查询轮播图配置
     * 
     * @param id 轮播图配置主键
     * @return 轮播图配置
     */
    @Override
    public ApiBanner selectApiBannerById(Long id)
    {
        return apiBannerMapper.selectApiBannerById(id);
    }

    /**
     * 查询轮播图配置列表
     * 
     * @param apiBanner 轮播图配置
     * @return 轮播图配置
     */
    @Override
    public List<ApiBanner> selectApiBannerList(ApiBanner apiBanner)
    {
        return apiBannerMapper.selectApiBannerList(apiBanner);
    }

    /**
     * 新增轮播图配置
     * 
     * @param apiBanner 轮播图配置
     * @return 结果
     */
    @Override
    public int insertApiBanner(ApiBanner apiBanner)
    {
        apiBanner.setCreateTime(DateUtils.getNowDate());
        return apiBannerMapper.insertApiBanner(apiBanner);
    }

    /**
     * 修改轮播图配置
     * 
     * @param apiBanner 轮播图配置
     * @return 结果
     */
    @Override
    public int updateApiBanner(ApiBanner apiBanner)
    {
        apiBanner.setUpdateTime(DateUtils.getNowDate());
        return apiBannerMapper.updateApiBanner(apiBanner);
    }

    /**
     * 批量删除轮播图配置
     * 
     * @param ids 需要删除的轮播图配置主键
     * @return 结果
     */
    @Override
    public int deleteApiBannerByIds(Long[] ids)
    {
        return apiBannerMapper.deleteApiBannerByIds(ids);
    }

    /**
     * 删除轮播图配置信息
     * 
     * @param id 轮播图配置主键
     * @return 结果
     */
    @Override
    public int deleteApiBannerById(Long id)
    {
        return apiBannerMapper.deleteApiBannerById(id);
    }
}
